package com.why.dao;

import com.why.pojo.News;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface NewsMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(News record);

    int insertSelective(News record);

    News selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(News record);

    int updateByPrimaryKey(News record);

    //查询最新5条新闻
    List<News> newsList();

    //分页查询新闻
    List<News> selectAllList();

    //判断标题是否唯一
    News selectNewsByTitle(String title);
}